package com.tanhua.user.controller;

import com.tanhua.user.service.VedioService;
import com.tanhua.user.vo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/manage")
public class VedioController {

    @Autowired
    private VedioService vedioService;

    @GetMapping("/videos")
    private PageResult vedioList(@RequestParam(value = "pagesize",required = false,defaultValue = "10") Integer pagesize,
                                 @RequestParam(value = "page",required = false,defaultValue = "1") Integer page,
                                 @RequestParam(value = "sortProp") String sortProp,// 发布时间 举报书 。。。。
                                 @RequestParam(value = "sortOrder") String sortOrder,//ascending 升序 descending 降序
                                 @RequestParam(value = "uid") Integer uid
                                 ){

        PageResult pageResult = vedioService.vedioList(pagesize,page,sortProp,sortOrder,uid);

        return pageResult;
    }
}
